home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / include / reference.h < prev    next >
C/C++ Source or Header  |  1993-07-01  |  1KB  |  38 lines

  1. /* Copyright (c) 1992 The Geometry Center; University of Minnesota
  2.    1300 South Second Street;  Minneapolis, MN  55454, USA;
  3.    
  4. This file is part of geomview/OOGL. geomview/OOGL is free software;
  5. you can redistribute it and/or modify it only under the terms given in
  6. the file COPYING, which you should have received along with this file.
  7. This and other related software may be obtained via anonymous ftp from
  8. geom.umn.edu; email: software@geom.umn.edu. */
  9.  
  10. /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
  11.  
  12. #ifndef REFCOMMDEF
  13. #define REFCOMMDEF
  14.  
  15. /*
  16.  * Public definitions for Reference & Communications package
  17.  */
  18.  
  19. #define REFERENCEFIELDS    \
  20.     int magic;        \
  21.     int ref_count;    \
  22.     struct Handle *handle;
  23.  
  24. typedef struct Ref  {
  25.     REFERENCEFIELDS
  26. } Ref ;
  27.  
  28. #define    REFINCR(type, obj)    (type *)RefIncr((Ref *)(obj))
  29. #define    REFDECR(obj)        RefDecr((Ref *)(obj))
  30.  
  31. extern void RefInit( Ref *, long magic );    /* Initializes a Reference */
  32. extern int  RefCount( Ref * );        /* Returns current ref count */
  33. extern Ref *RefIncr( Ref * );        /* Increments count, returns object */
  34. extern int  RefDecr( Ref * );        /* Decrements count, returns it  */
  35. extern int  RefMagic( Ref * );        /* Returns magic number */
  36.  
  37. #endif
  38.